$("#login").submit(
	var self=$(this),
		mail = self.find('input[name=mail]'),
		password = self.find('input[name=password]'),
		mail_val = ma	il.val(),
		password_val = password.val()
	;
	
	if(!mail_val){
		mail.focus();
		return false
	}
	
	if(!password_val){
		password.focus()
		return false
	}

	$.phone(
		this.action,
		{
			password:password, 
			mail:mail
		},function (o){
			if(o.error)
			alert(o.error);
			mail.focus().select()
		}
	)
	return false;
)